package com.example.gybicycle.service;

import java.util.Date;
import com.example.gybicycle.common.entity.Result;
import com.example.gybicycle.common.sql.CrudService;
import com.example.gybicycle.entity.SysCaption;
import com.example.gybicycle.dao.SysCaptionDao;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysCaptionService extends CrudService<SysCaptionDao, SysCaption> {
    @Override
    public SysCaption get(Integer id) {
        SysCaption table=super.get(id);
        return table;
    }
    public Result save(SysCaption entity,Integer loginId){
        int num=0;
        if(entity.getId()==null||entity.getId()==0){

            num=dao.insert(entity);
        }else {

            num=dao.update(entity);
        }
        if(num>0)
            return Result.success(entity);
        else 
            return Result.fail("保存失败");
    }
    public List<SysCaption> findList(SysCaption entity){
        List<SysCaption> list=super.findList(entity);
        return list;
    }


}